#include "Solution.h"
#include <iostream>

using namespace std;
int main()
{
	int n;
	cin>>n;
	cout<<Solution().totalNQueens(n);

	while(cin.get() != '\n');
	cin.get();
}